import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:god_logistics/utils/showToast.dart';
import 'package:god_logistics/utils/tokenManage.dart';

class Newspage extends StatefulWidget {
  const Newspage({super.key});

  @override
  State<Newspage> createState() => _NewspageState();
}

class _NewspageState extends State<Newspage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: MediaQuery.of(context).size.width,
      height: MediaQuery.of(context).size.width,

      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          // Image.asset('assets/icons/ic_not_found.png'),
          // Text('暂无')
          ElevatedButton(
            onPressed: () async {
              TokenManager().saveToken(
                'eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI1MDYwNzE0MTExMDc2MjMzMTAwIiwiYWNjb3VudCI6Ind5aDEyMzQ1NiIsIm5hbWUiOiLlj7jmnLoiLCJvcmdpZCI6MTAyNDk5MDcyNjUxOTQwMzQ1Nywic3RhdGlvbmlkIjoxMDI0NzA3NTM1ODkxOTQ0NzY5LCJhZG1pbmlzdHJhdG9yIjpmYWxzZSwiZXhwIjoxNzQ5NDE2ODMzfQ.h0TX5LNq_VqE7u2-QbLBp1gaIZNiFknZgdBnt9Y7zrauHKjJT5W1RaS-ZuSmv456oGGAgPodWCE5gMphadPLcQ',
              );
              var res = await TokenManager().getToken();
              ToastUtil.showInfo('${res}');
            },
            child: Text('存储token测试'),
          ),
          ElevatedButton(
            onPressed: () async {
              TokenManager().removeToken();
              var res = await TokenManager().getToken();
              ToastUtil.showInfo('${res}');
            },
            child: Text('删除token测试'),
          ),
          ElevatedButton(
            onPressed: () async {
              var res = await TokenManager().getToken();
              ToastUtil.showInfo('${res}');
            },
            child: Text('查看token测试'),
          ),
        ],
      ),
    );
  }
}
